/**
 * 
 */
package gui;

import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.JButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JLabel;

import main.Controller;

/**
 * @author Christian
 * @since 0.15c
 */
public class Import extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 
	 */
	private JButton jImportButton = null;
	
	/**
	 * 
	 */
	private JLabel jInfoLabel = null;
	
	/**
	 * 
	 */
	private JPanel jButtonPanel = null;
	
	/**
	 * 
	 */
	private JButton jzurueckButton = null;
	
	/**
	 * 
	 */
	private JButton jImportierenButton = null;
	
	/**
	 * 
	 */
	private ImportController importController = new ImportController(this); // @jve:decl-index=0:
	
	/**
	 * 
	 */
	private JLabel jLabel = null;
	
	/**
	 * This method initializes
	 * 
	 */
	public Import() {

		super();
		initialize();
	}
	
	/**
	 * This method initializes this
	 * 
	 */
	private void initialize() {

		GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
		gridBagConstraints31.gridx = 0;
		gridBagConstraints31.gridy = 0;
		jLabel = new JLabel();
		jLabel.setText("Textbausteine importieren");
		GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
		gridBagConstraints21.gridx = 0;
		gridBagConstraints21.insets = new Insets(15, 5, 15, 5);
		gridBagConstraints21.gridy = 3;
		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
		gridBagConstraints1.gridx = 0;
		gridBagConstraints1.gridy = 2;
		jInfoLabel = new JLabel();
		jInfoLabel.setText("-");
		GridBagConstraints gridBagConstraints = new GridBagConstraints();
		gridBagConstraints.gridy = 1;
		gridBagConstraints.gridx = 0;
		gridBagConstraints.insets = new Insets(5, 5, 25, 5);
		this.setLayout(new GridBagLayout());
		this.setSize(new Dimension(496, 339));
		this.add(getJImportButton(), gridBagConstraints);
		this.add(jInfoLabel, gridBagConstraints1);
		this.add(getJButtonPanel(), gridBagConstraints21);
		this.add(jLabel, gridBagConstraints31);
	}
	
	/**
	 * @return JInfoLabel
	 */
	public JLabel getjInfoLabel() {

		return jInfoLabel;
	}
	
	/**
	 * This method initializes jImportButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJImportButton() {

		if (jImportButton == null) {
			jImportButton = new JButton();
			jImportButton.setText("Datei auswählen");
			jImportButton.addActionListener(importController);
		}
		return jImportButton;
	}
	
	/**
	 * This method initializes jButtonPanel
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJButtonPanel() {

		if (jButtonPanel == null) {
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
			gridBagConstraints3.gridx = 1;
			gridBagConstraints3.gridy = 0;
			gridBagConstraints3.insets = new Insets(5, 5, 5, 5);
			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
			gridBagConstraints2.gridx = 0;
			gridBagConstraints2.gridy = 0;
			gridBagConstraints2.insets = new Insets(5, 5, 5, 5);
			jButtonPanel = new JPanel();
			jButtonPanel.setLayout(new GridBagLayout());
			jButtonPanel.add(getJzurueckButton(), gridBagConstraints2);
			jButtonPanel.add(getJImportierenButton(), gridBagConstraints3);
		}
		return jButtonPanel;
	}
	
	/**
	 * This method initializes jzurückButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJzurueckButton() {

		if (jzurueckButton == null) {
			jzurueckButton = new JButton();
			jzurueckButton.setText("zurück");
			jzurueckButton.addActionListener(new ActionListener() {
				
				
				@Override
				public void actionPerformed(ActionEvent e) {

					Controller.getGuiController().zeigeHauptfenster();
				}
			});
		}
		return jzurueckButton;
	}
	
	/**
	 * This method initializes jImportierenButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJImportierenButton() {

		if (jImportierenButton == null) {
			jImportierenButton = new JButton();
			jImportierenButton.setText("importieren");
			jImportierenButton.addActionListener(importController);
		}
		return jImportierenButton;
	}
} // @jve:decl-index=0:visual-constraint="297,28"
